From 355c390583ff09a3f4c03a0584e7389011de0065 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Tue, 2 Feb 2010 19:17:14 +0000 Subject: [PATCH] Merge alternative readme into main file. Two ways to install phpunit, document them both. Drop run-test.php method of running files doesn't work. Update makefile. TODO: Merge all of the nasty global setup crap into a common wrapper (maybe MediaWiki_TestCase?) so we don't have to constantly reinvent the whell. --- tests/Makefile | 16 ++++------------ tests/README | 17 ++++++++++++++++- tests/README.ALTERNATIVE | 24 ------------------------ tests/run-test.php | 4 ---- 4 files changed, 20 insertions(+), 41 deletions(-) delete mode 100644 tests/README.ALTERNATIVE delete mode 100644 tests/run-test.php diff --git a/tests/Makefile b/tests/Makefile index 25ccda3523..545a8b1962 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,19 +1,11 @@ .PHONY: help test all test: - php run-test.php ArticleTest.php - php run-test.php GlobalTest.php - php run-test.php DatabaseTest.php - php run-test.php ImageFunctionsTest.php - php run-test.php SearchMySQL4Test.php + phpunit install: - cvs -z9 -d:pserver:cvsread:@cvs.php.net:/repository/ co -P pear/PHPUnit - mv pear/PHPUnit . - rm -rf pear -clean: - rm -rf PHPUnit pear + pear channel-discover pear.phpunit.de + pear install phpunit/PHPUnit help: # Options: # test (default) Run the unit tests - # install Install PHPUnit from CVS - # clean Remove local PHPUnit install + # install Install PHPUnit from phpunit.de # help You're looking at it! diff --git a/tests/README b/tests/README index 562ee28a1f..b52e790e1d 100644 --- a/tests/README +++ b/tests/README @@ -1,5 +1,5 @@ Some quickie unit tests done with the PHPUnit testing framework. To run the -test suite, run 'make test' in this dir. +test suite, run 'make test' in this dir. This directly invokes 'phpunit.' PHPUnit is no longer maintained by PEAR. To get the current version of PHPUnit, first uninstall any old version of PHPUnit or PHPUnit2 from PEAR, @@ -7,3 +7,18 @@ then install the current version from phpunit.de like this: # pear channel-discover pear.phpunit.de # pear install phpunit/PHPUnit + +You also may wish to install this via your normal package mechanism: + +# aptitude install phpunit + - or - +# yum install phpunit + +Notes: +- Label currently broken tests in the group Broken and they will not + be run by phpunit. You can add them to the group by putting the + following comment at the top of the file: + /** + * @group Broken + */ +- Need to fix some broken tests diff --git a/tests/README.ALTERNATIVE b/tests/README.ALTERNATIVE deleted file mode 100644 index 4178e09f61..0000000000 --- a/tests/README.ALTERNATIVE +++ /dev/null @@ -1,24 +0,0 @@ -This file describes an alternative way of testing from that in README -since the README method didn't work for me. - - - Put a LocalSettings.php in the parent directory. If you checked - out mediawiki/trunk/phase3 as a directory called mediawiki, then - this is where your LocalSettings.php file would go. - - Install PHPUnit. I used version 3.3.16 from Ubuntu. - ("aptitude install phpunit"). - - Invoke phpunit directly instead of using make. This uses the - phpunit.xml file to run the tests. - - Fix broken tests. - - Label currently broken tests in the group Broken and they will not - be run by phpunit. You can add them to the group by putting the - following comment at the top of the file: - - /** - * @group Broken - */ - - - -NOTE: I haven't yet determined why but my PHP installation would -sometimes segfault while linting the files. PHPUnit uses "php -l" to -check file syntax and this is where the segfaults were happening. diff --git a/tests/run-test.php b/tests/run-test.php deleted file mode 100644 index c8d9872636..0000000000 --- a/tests/run-test.php +++ /dev/null @@ -1,4 +0,0 @@ -